package edu.zut.cs.software.person.customer.domain;

/**
 * 
 * @author wenmanke
 * customer member information
 *
 */
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import edu.zut.cs.software.teach.Base.domain.BaseTreeEntity;


@Entity
@Table(name = "T_CustomerCategory")
@NamedQueries({ @NamedQuery(name = "CustomerCategory.getRoot", query = "select m from CustomerCategory m where m.parent is null") })

public class CustomerCategory extends BaseTreeEntity<CustomerCategory,Long> {

	private static final long serialVersionUID = -2411978175041541798L;
	
	/**
	 * customer name
	 */
	@Column
	String cname;
	/**
	 * customer phone
	 */
	@Column
	Long phone;
	/**
	 * customer member card
	 */
	@Column
	String card;
	@OneToMany(mappedBy = "customerCategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<Customer> customer;
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	public Long getPhone() {
		return phone;
	}
	public void setPhone(Long phone) {
		this.phone = phone;
	}
	public String getCard() {
		return card;
	}
	public void setCard(String card) {
		this.card = card;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}